import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';

export class CreateOrderDto {
  @ApiProperty({ description: '用户ID' })
  userId?: number;

  @ApiProperty({ description: '餐厅ID' })
  @IsNotEmpty({ message: '餐厅ID不能为空' })
  restaurantId: number;

  @ApiProperty({
    description: '订单状态：0-未支付，1-已支付，2-正在制作，3-已上菜',
  })
  @IsNotEmpty({ message: '订单状态不能为空' })
  status: string;

  @ApiProperty({ description: '订单备注' })
  remark: string;

  @ApiProperty({ description: '订单总金额' })
  @IsNotEmpty({ message: '订单总金额不能为空' })
  totalAmount: number;

  @ApiProperty({ description: '订单菜品列表' })
  @IsNotEmpty({ message: '订单菜品列表不能为空' })
  @IsString({ message: '订单菜品列表必须是字符串' })
  dishList: string;
}
